def decorator(fn):
    def inner():
        print('前面添加功能')
        fn()
        print('后面添加功能')

    return inner


@decorator
def fn1():
    print('fn1')


@decorator
def fn2():
    print('fn2')


if __name__ == '__main__':
    fn1()
    fn2()
